/**
 * 单选按钮初始化
 */
const  initRadio = (dataForm, initForm,attribute) => {
	//[{name:'女',value:0},{name:'男',value:1},{name:'中',value:2}]
	initForm[attribute.attrName] =attribute.initValue? attribute.initValue:[] //设置初始值
	dataForm[attribute.attrName] = attribute.defaultValue||attribute.defaultValue==0?attribute.defaultValue:'' //设置默认值
	// const response = await request({
	// 	url: 'http://192.168.0.114:8030/remote.js'
	// });
	// console.error(response)
	//检查key值是否一致
	if(!attribute.keyValue){
		return
	}
	for (let index in attribute.initValue) {
		initForm[attribute.attrName].push({
			label: attribute.keyValue ? attribute.initValue[index][attribute.keyValue[0]] : attribute.initValue[index]["label"],
			value: attribute.keyValue ? attribute.initValue[index][attribute.keyValue[1]] : attribute.initValue[index]["value"]
		})
	}
}

 export default initRadio